From e198e6a43a47e9dbdf2ba3cc49f674b26dccea85 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 2 Jan 2024 22:13:40 -0800
Subject: fix(badges): no set uncategorised on update

---
 src/routes/user/[user]/badges/+page.svelte | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'src/routes/user/[user]/badges/+page.svelte')

diff --git a/src/routes/user/[user]/badges/+page.svelte b/src/routes/user/[user]/badges/+page.svelte
index b8a9c793..51670bdf 100644
--- a/src/routes/user/[user]/badges/+page.svelte
+++ b/src/routes/user/[user]/badges/+page.svelte
@@ -173,7 +173,7 @@
 		const groupedBadges: GroupedBadges = {};
 
 		badges.forEach((badge) => {
-			if (!badge.category) badge.category = 'Uncategorized';
+			if (!badge.category) badge.category = 'Uncategorised';
 
 			if (!groupedBadges[badge.category]) groupedBadges[badge.category] = [];
 
@@ -259,7 +259,11 @@
 				minlength="1"
 				maxlength="1000"
 				size="11"
-				value={selectedBadge ? selectedBadge.category : ''}
+				value={selectedBadge
+					? selectedBadge.category === 'Uncategorised'
+						? ''
+						: selectedBadge.category
+					: ''}
 			/>
 			<a href={`#`} on:click={submitBadge}>{selectedBadge ? 'Update' : 'Add'} Badge</a>
 			{#if selectedBadge}
-- 
cgit v1.2.3

